import os

currentLine = ""
lineElementsList = []

outputFileName = "/home/weijiang/workspace/polyIRToolkit/polyIRIndexer/clueWebOffcialIndexPathsALL.txt"

outputFileHandler = open(outputFileName,"w")

for dirname, dirnames, filenames in os.walk('/data3/DummyClueWeb09_English_1'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)

for dirname, dirnames, filenames in os.walk('/data2/ClueWeb09_English_1'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)

for dirname, dirnames, filenames in os.walk('/data2/ClueWeb09_English_2'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data2/ClueWeb09_English_3'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data2/ClueWeb09_English_4'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)

for dirname, dirnames, filenames in os.walk('/data2/ClueWeb09_English_5'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data3/ClueWeb09_English_6'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data3/ClueWeb09_English_7'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data3/ClueWeb09_English_8'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)
        
for dirname, dirnames, filenames in os.walk('/data3/ClueWeb09_English_9'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)

for dirname, dirnames, filenames in os.walk('/data3/ClueWeb09_English_10'):
    #for subdirname in dirnames:
    #    print os.path.join(dirname, subdirname)
    for filename in filenames:
        currentLine = os.path.join(dirname, filename)
        lineElementsList.append(currentLine)       


lineElementsList.sort(cmp=None, key=None, reverse=False)

for everyLine in lineElementsList:
    outputFileHandler.write(everyLine + "\n")
    #print everyLine
    
outputFileHandler.close()